#define _CRT_SECURE_NO_WARNINGS
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
int cmp(const void* p1, const void* p2)
{
    return *(int*)p1 - *(int*)p2;
}
int findRadius(int* houses, int housesSize, int* heaters, int heatersSize) {
    int R_pre = 0;
    int i, j;
    qsort(houses, housesSize, sizeof(int), cmp);
    qsort(heaters, heatersSize, sizeof(int), cmp);
    if (heatersSize == 1)
    {
        R_pre = abs(houses[0] - heaters[0]) > abs(houses[housesSize - 1] - heaters[0]) ?
            abs(houses[0] - heaters[0]) : abs(houses[housesSize - 1] - heaters[0]);
    }
    else
    {
        for (i = 0; i < housesSize; i++)
        {
            int tmp = 0; long long R = 10000000000;
            for (j = 0; j < heatersSize - 1; j++)
            {
                tmp = abs(houses[i] - heaters[j]);
                int next = abs(houses[i] - heaters[j + 1]);
                if (tmp <= R && tmp <= next)
                {
                    R = tmp;
                    break;
                }
                else
                {
                    R = next;
                }

            }
            if (R > R_pre)
            {
                R_pre = R;
            }
        }
    }
    return R_pre;
}
int main()
{
    return 0;
}